package jcrosswords.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class PropertyManager {

	private static PropertyManager instance;

	private static Properties properties;

	private PropertyManager() {

		properties = new Properties();
		
		//@TODO wir sollen im zukunft log system anweden 
		try {
			properties.load(new FileInputStream("jcrosswords.properties"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
	
	public String get(String key){
		return properties.getProperty(key);
	}
	
	public static PropertyManager getInstance(){
		
		if(instance==null){
			instance=new PropertyManager();
		}
		
		return instance;
	}

}
